1. Field of the Invention
The present invention relates generally to computer-implemented printing systems, and in particular, to a method for performing accurate and reliable page size selection in a PostScript(trademark) device.
2. Description of the Related Art
PostScript(trademark) is a general purpose computer language developed by Adobe Systems, Inc. that has become a standard for device-independent output. PostScript(trademark) is most commonly used for supplying page description information to output devices such as printers and can describe elements including text, graphics, and scanned images.
Many PostScript(trademark) printers 116 have special hardware features, such as multiple paper trays with different sizes of paper, duplex printing, collation, finishing options, and so on. These features are modeled in a Page Device Dictionary and can be altered or selected by a SetPageDevice operator. If a feature is selected, but does not exist in the Page Device Dictionary, then a Policies Dictionary is accessed to determine what steps to perform in response thereto.
For example, the PageSize entry in the Page Device Dictionary is an array that defines the width and height of one or more media sources available in the device. The SetPageDevice operator invoked by a page description attempts to match the size selection of the page description with the size of the media sources available in the printer, within a specified tolerance. If a match cannot be made, a PageSize Policy procedure in the Policies dictionary is triggered to perform a specified series of steps.
Unfortunately, the steps performed by the PageSize Policy are unduly limited. Generally, these steps are limited to: (1) generating a configuration error; (2) ignoring the requested PageSize; (3) interacting with a human operator or print manager; (4) selecting the nearest available medium and adjusting the page to fit the medium; (5) selecting the next larger available medium and adjusting the page to fit the medium; (6) selecting the nearest available medium, but not adjusting the page, or (7) selecting the next larger available medium, but not adjusting the page. Therefore, there exists a need in the art for techniques that provide more flexibility in the handling of mismatched page size requests in PostScript(trademark) devices.
To overcome the limitations in the prior art described above, and to overcome other limitations that will become apparent upon reading and understanding the present specification, the present invention discloses a method and apparatus for performing accurate and reliable page size selection in a PostScript(trademark) device. A PolicyReport procedure is downloaded into the device to perform the following steps. If the device is using a non-standard PaperSize Policy, then the procedure uses the PageSize SetPageDevice call; otherwise, the procedure loops through the PageSizes for each media source stored in the InputAttributes dictionary to find the nearest PageSize entry favoring non-rotated over rotated for identical match sizes. The loop is terminated when an exact match is found with no rotation or when all available paper sizes have been exhausted. The loop is optimized not to look for closest matches once it has found a perfect size match and to terminate when it has found a perfect non-rotated match.